home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 132_01 / cdef.h < prev    next >
Text File  |  1985-08-19  |  3KB  |  104 lines

  1. /*    A SMALL C COMPILER    */
  2. /*    VERSION 1.1        */
  3. /* By    Ron Cain        */
  4. /* Modified:            */
  5. /*    12/16/80    by     A.Griggs    */
  6. /*                            */
  7. /*     Define system dependent parameters        */
  8. #INCLUDE BDSCIO.H
  9. /* Stand alone definitions                */
  10. #DEFINE    eol    13
  11. #DEFINE lf    10
  12. /*    Unix definitions (if not stand alone)        */
  13. /*#INCLUDE    <stdio.h>                */
  14. /*#DEFINE    eol    10                */
  15. /*    Define the syjbol table parameters        */
  16. #DEFINE    symsiz    14
  17. #DEFINE    symtbsz    5040
  18. #DEFINE    numglbs    300
  19. #DEFINE    startglb    symtab
  20. #DEFINE    endglb    startglb+numglbs*symsiz
  21. #DEFINE startloc endglb+symsiz
  22. #DEFINE endloc symtab+symtbsz-symsiz
  23. /*    define symbol table entry points        */
  24. #DEFINE    name    0
  25. #DEFINE    type    10
  26. #DEFINE    ident    9
  27. #DEFINE    storage    11
  28. #DEFINE    offset    12
  29. /*    System wide name size (for symbols)        */
  30. #DEFINE    namesize    9
  31. #DEFINE    namemax    8
  32. /*    define possible entries for ident        */
  33. #DEFINE    variable    1
  34. #DEFINE    array    2
  35. #DEFINE    pointer    3
  36. #DEFINE    function    4
  37. /*    define possible entries for type        */
  38. #DEFINE    cchar    1
  39. #DEFINE    cint    2
  40. /*    define possible entries for "storage"        */
  41. #DEFINE    statik    1
  42. #DEFINE    stkloc    2
  43. /*    define the "while" statment queue        */
  44. #DEFINE    wqtabsz    100
  45. #DEFINE    wqsiz    4
  46. #DEFINE    wqmax    wq+wqtabsz-wqsiz
  47. /*    define entry offset in while que        */
  48. #DEFINE    wqsym    0
  49. #DEFINE    wqsp    1
  50. #DEFINE    wqloop    2
  51. #DEFINE    wqlab    3
  52. /*    define the literal pool                */
  53. #DEFINE    litabsz    2000
  54. #DEFINE    litmax    litabsz-1
  55. /*    define the input line                */
  56. #DEFINE linesize MAXLINE
  57. #DEFINE    linemax    linesize-1
  58. #DEFINE    mpmax    linemax
  59. /*    define the macro (define) pool            */
  60. #DEFINE    macqsize    1000
  61. #DEFINE    macmax    macqsize-1
  62. /*    define statement types (tokens)            */
  63. #DEFINE    stif    1
  64. #DEFINE    stwhile    2
  65. #DEFINE    streturn    3
  66. #DEFINE    stbreak    4
  67. #DEFINE    stcont    5
  68. #DEFINE    stasm    6
  69. #DEFINE    stexp    7
  70. /*    Reserve some storage words            */
  71. char iobuf0[BUFSIZ];        /* write buffer        */
  72. char iobuf1[BUFSIZ];        /* Read buffer        */
  73. char iobuf2[BUFSIZ];        /* Include read buffer    */
  74. char    symtab[symtbsz];    /* symbol table        */
  75. char    *glbptr,*locptr;    /* ptrs to next entries    */
  76. int    wq[wqtabsz];        /* while queue        */
  77. int    *wqptr;            /* ptr to next entry    */
  78. char    litq[litabsz];        /* literal pool        */
  79. int    litptr;            /* ptr to next entry    */
  80. char    macq[macqsize];        /* macro string buffer    */
  81. int    macptr;            /*   and its index    */
  82. char    line[linesize];        /* parsing buffer    */
  83. char    mline[linesize];    /* temp macro buffer    */
  84. int    lptr,mptr;        /* ptrs into each    */
  85. /*    Miscellaneous storage                */
  86. int    nxtlab,    /* next available label#*/
  87.     litlab,    /* label # assigned to literal pool*/
  88.     sp,    /* compiler relative stack pointer    */
  89.     argstk,    /* function argument stack pointer    */
  90.     ncmp,    /* # of open compound statments        */
  91.     errcnt,    /* # of errors in compilation        */
  92.     eof,    /* set non-zero on final input eof    */
  93.     input,    /* iob # for input file            */
  94.     output,    /* iob # for output file (if any)    */
  95.     input2,    /* iob # for "include" file        */
  96.     glbflag,/* non-zero if internal globals        */
  97.     ctext,    /* non-zero to intermix c-source    */
  98.     cmode,    /* non-zero while parsing c-code    */
  99.         /* zero when parsing assembly code    */
  100.     lastst;    /* last executed statement type        */
  101. char    quote[2];    /* literal string for '"'    */
  102. char    *cptr;        /* work ptr to any char buffer    */
  103. int    *iptr;        /* work ptr to any int buffer    */
  104. °╤ß▌6╔#╛ ∩#F±ß■.(ΦEQGTLTGELE    NE σ┼═╧!┴δπ╦P /╦H ;σ╖φRß(8╦` >╦P :╦h 6=╦@ 07╦X *╦H &╦h ")╦|(